<!--
  Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.

  https://www.mall4j.com/

  未经允许，不可做商业用途！

  版权所有，侵权必究！
-->

<template>
  <div class="Mall4j goods-module-two-component">
    <goods-module-two :config="configMessage" />
  </div>
</template>
<script setup>
import goodsModuleTwo from '../goods-component/goods-module-two/index.vue'

const props = defineProps({
  itemComponent: { // 组件信息
    type: Object,
    default: () => {}
  }
})

const configMessage = ref({
  title: '主标题'
})

watch(() => props.itemComponent, (newVal) => {
  if (JSON.stringify(newVal.rightConfigMessage) !== '{}') {
    configMessage.value = {
      title: newVal.rightConfigMessage.title, // 自定义标题
      maingoodsList: newVal.rightConfigMessage.maingoodsList, // 主商品
      othergoodsList: newVal.rightConfigMessage.othergoodsList, // 其他商品
      path: newVal.rightConfigMessage.path // 跳转路径
    }
  }
}, {
  immediate: true,
  deep: true
})

</script>

<style lang="scss" scoped>
.goods-module-two-component {
  width: 1200px;
  margin: 0 auto;
}
</style>
